/*********************************************************
          File Name:16.21.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sun 13 Dec 2015 06:56:38 PM CST
**********************************************************/

#include <iostream>
#include <memory>

class DebugDelete
{
        public:
                DebugDelete() = default;
                ~DebugDelete() = default;

                template<typename T> void operator()(T *x)
                {
                        std::cout << "executing delete...\n";
                        delete x;
                }
};

int main(void)
{
        std::unique_ptr<int, DebugDelete> p(new int, DebugDelete());

        return 0;
}
